package cn.highset.modules.base.controller.manage;

import cn.highset.common.utils.ResultUtil;
import cn.highset.common.vo.Result;
import cn.highset.modules.base.service.mybatis.ICountryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author Victor
 */
@Slf4j
@RestController
@Api(description = "国家表管理接口")
@RequestMapping("/highset/country")
@Transactional
public class CountryController {

    @Autowired
    private ICountryService iCountryService;


    @RequestMapping(value = "/getAll", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取全部数据")
    public Result<List<Map<String, Object>>> getAll() {
        return new ResultUtil<List<Map<String, Object>>>().setData(iCountryService.countryList());
    }

}
